﻿@page "/post/{year:int:length(4)}/{month:int:range(1,12)?}"
@model Moonglade.Web.Pages.ArchiveListModel
@{
    ViewBag.TitlePrefix = $"All Posts in {Model.ArchiveInfo}";
}

<h3>
    @ViewBag.TitlePrefix
</h3>
<hr />
<div>
    @if (!Model.Posts.Any())
    {
        <div class="alert alert-warning">
            @SharedLocalizer["No Posts"]
        </div>
    }
    else
    {
        foreach (var item in Model.Posts.OrderByDescending(s => s.PubDateUtc))
        {
            <partial name="_PostListEntry" model="item" />
            <div class="mb-4 d-none d-md-block"></div>
            <hr class="d-none d-md-block" />
        }
    }
</div>

<partial name="_LightSwitch" />